package com.huarui.dictionary.dao.impl;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.impl.BaseDaoImpl;

import com.huarui.dictionary.dao.IDictionaryDao;
import com.huarui.dictionary.model.Dictionary;

public class DictionaryDao extends BaseDaoImpl implements IDictionaryDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<Dictionary> getAll() {
		return this.getSqlMapClientTemplate().queryForList(
				namespace + ".getAll");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<String> geGropList() {

		return this.getSqlMapClientTemplate().queryForList(
				namespace + ".getGroups");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Dictionary> getSubDictionaryList(String group) {
		return this.getSqlMapClientTemplate().queryForList(
				namespace + ".getSubLevel", group);
	}
	
	@Override
	public Integer getDictionaryListCountByComplex(Map<String, Object> paramsMap) {
		return (Integer) this.getSqlMapClientTemplate().queryForObject(super.namespace + ".getDictionaryListCountByComplex", paramsMap);
	}
	
	@Override
	@SuppressWarnings("unchecked")
	public List<Map<String, Object>> listDictionaryByComplex(Map<String, Object> paramsMap) {
		return this.getSqlMapClientTemplate().queryForList(super.namespace + ".listDictionaryByComplex", paramsMap);
	}

}
